package ConCom.test2;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class MapTest extends Mapper<LongWritable, Text, Text, Text> {
    @Override
    protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, Text, Text>.Context context) throws IOException, InterruptedException {
        if (!value.toString().startsWith("S")) {
            String[] datas = value.toString().split(",");
            if (datas[6].equals("") || datas[10].equals("") || datas[11].equals("")) {
                Count.count += 1;
            } else {
                context.write(new Text(), value);
            }
        } else {
            Count.header = value.toString();
        }
    }
}
